<template>
	<view class="xc-wrap">

		<view class="xc-block">
			<uv-form labelPosition="left" :model="control.form" :rules="control.rules" ref="form">


				<uv-form-item label="地址" prop="area" required borderBottom>
					<uv-input v-model="control.form.area" border="surround" disabled="true">
					</uv-input>
				</uv-form-item>

				<uv-form-item label="站点名称" prop="memo" required borderBottom>
					<uv-input v-model="control.form.name" border="surround" disabled="true">
					</uv-input>
				</uv-form-item>

				<uv-form-item label="资产码" prop="memo" required borderBottom>
					<uv-input v-model="control.form.code" border="surround" disabled="true">
					</uv-input>
				</uv-form-item>


				<uv-form-item label="现场情况" prop="qingkuang" required borderBottom>
					<uv-input v-model="control.form.qingkuang" border="surround" disabled="true">
					</uv-input>
				</uv-form-item>


				<uv-form-item label="事故原因" prop="yuanyin" required borderBottom>
					<uv-input v-model="control.form.yuanyin" border="surround" disabled="true">
					</uv-input>
				</uv-form-item>


				<uv-form-item label="事故描述" prop="memo" required borderBottom>
					<uv-textarea v-model="control.form.miaoshu" border="surround" disabled="true">
					</uv-textarea>
				</uv-form-item>

				<uv-form-item label="图片" prop="control.form.image" required borderBottom>
					<xc-uv-upload v-model="control.form.image" maxCount="1" disabled="true"></xc-uv-upload>
				</uv-form-item>


			</uv-form>
			<!-- <uv-button type="primary" text="提交" customStyle="margin-top: 10px" @tap="control_submit"></uv-button> -->

		</view>
	</view>
</template>

<script>
	import cityPicker from '@/uni_modules/piaoyi-cityPicker/components/piaoyi-cityPicker/piaoyi-cityPicker';
	import config from "@/config/config.js";
	import xcUniappUtils from '@/library/xcore/js/XcUniappUtils.js';
	import xcViewUtils from '@/library/xcore/js/XcViewUtils.js';
	import xcHttpUtils from '@/library/xcore/js/XcHttpUtils.js';
	import xcCloginUtils from '@/library/xcore/js/XcCloginUtils.js';
	import {
		xsStringUtils,
		xsDateUtils,
		xsArrayUtils
	} from 'xstack-for-javascript';

	export default {
		data() {
			return {
				id:'',
				visible: false,
				columns: [
					['一级', '二级', '三级']
				],
				columns2: [
					['车辆原因', '设备原因']
				],
				maskCloseAble: true,
				str: '',
				defaultValue: '420103',
				// defaultValue: ['河北省','唐山市','丰南区'],
				column: 3,
				str2: '',
				radioList: [{
						text: '安全员',
						value: 1,
						checked: true
					},
					{
						text: '项目经理',
						value: 2,
						checked: false
					}
				],
				selectedValue: 1, // 用于存储选中的值
				shenfen: '无',
				config: config,
				xsStringUtils: xsStringUtils,
				xsDateUtils: xsDateUtils,
				sp: {},
				sr: {},
				control: {
					form: {
					
					}
				}
			}
		},
		components: {
			cityPicker
		},
		onLoad(options) {
			let that = this;
			this.id = options.id
			that.getdata();
		},
		onShow() {
			let that = this;
			xcUniappUtils.onShow(function() {
				that.public_show();
			});
		},
		onPullDownRefresh() {
			let that = this;
			setTimeout(function() {
				that.public_show();
				uni.stopPullDownRefresh();
			}, 1000);
		},
		methods: {
			getdata(){
				var that = this
				uni.request({
					url: 'https://shanghaihuxi.cn/api/index/getYujingDetail?id='+that.id,
					method: 'GET',
					header: {
						'Content-Type': 'application/json' // 请求头，可以根据接口要求修改
					},
					success: (res) => {
						that.control.form = res.data.data
					
						console.log(2222, that.info)
					}
				});
			}
		},

	}
</script>

<style lang="scss">
	.xp-mp-avatar {
		position: absolute;

		.avatar-wrapper {
			padding: 0px;
		}
	}

	.container {
		padding: 20px;
	}

	.radio-item {
		display: flex;
		align-items: center;
		margin-bottom: 10px;
	}
</style>